REPORT OPENSQL.
DATA: GV_CARRID LIKE SFLIGHT-CARRID VALUE 'AA',
GV_CONNID LIKE SFLIGHT-CONNID.

*INTO 要空格后再接冒号
*NATIVE SQL需要在变量前使用冒号，同时需使用MANDT字段
EXEC SQL.
SELECT A.CONNID
INTO :GV_CONNID
FROM SFLIGHT A
WHERE A.MANDT = :SY-MANDT AND A.CARRID = :GV_CARRID
ENDEXEC.

WRITE GV_CONNID.